const path = require("path"); //引入path模块
function resolve(dir) {
    return path.join(__dirname, dir); //path.join(__dirname)设置绝对路径
}
module.exports = {
    devServer: {
        //跨域
        publicPath: '/',
        host: "",
        open: true,
        proxy: {
            "/api": {
                target: process.env.VUE_APP_API,
                changeOrigin: true,
                //secure: true,  // 如果是https接口，需要配置这个参数
                pathRewrite: { "^/api": "/api" },
            },
        },
        
    },

    configureWebpack: (config) => {
        // 打包时取消console打印    
        config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
    },
    
    configureWebpack: {
        resolve: {
          alias: {
            '@': resolve('src')
          }
        }
    },
};